package com.example.btmac;

import com.example.btmac.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;

public class MainActivity extends Activity implements OnClickListener {
	
	private TextView tv1;
	private TextView tv2;
	private TextView tv3;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
		init();
	}

	private void init() {
		tv1 = (TextView) findViewById(R.id.tv1);
		tv2 = (TextView) findViewById(R.id.tv2);
		tv3 = (TextView) findViewById(R.id.tv3);
		
		tv1.setOnClickListener(this);
		tv2.setOnClickListener(this);
		tv3.setOnClickListener(this);
	}

	@Override
	public void onClick(View view) {
		switch (view.getId()) {
		case R.id.tv1:
			Intent intent = new Intent(this, FirstActivity.class);
			startActivity(intent);
			break;
		case R.id.tv2:
			Intent intent2 = new Intent(this, SecendActivity.class);
			startActivity(intent2);
			break;
		case R.id.tv3:
			Intent intent3 = new Intent(this, ThirdActivity.class);
			startActivity(intent3);
			break;
		default:
			break;
		}
	}
}
